Entity-Relationship Diagrams
•	(addendum to ER Model notes)
•	Entities and Attributes
•	Relationships
•	Alternative notations
What can the DBMS layer guarantee?
•	DBMS = Database Management System 
•	(Relational model preview)
•	Entity integrity
–	Uniqueness (using primary key)
•	Referential integrity
–	Entity referred to actually exists
–	How can it guarantee this?
Entities
•	Rectangle for entity type
•	Entity type name above rectangle
•	Attributes, one per row, inside rectangle
Relationships
•	Single line
•	Cardinality
–	Single perpendicular segment for "1"
–	"Crow's feet" for "many"
•	Participation
–	If optional, circle through relationship line
Example
•	http://www-3.ibm.com/software/data/informix/pubs/library/visionary/infoshelf/sqlt/08.fm3.html 
Alternatives
•	For Bachman-style diagrams
–	Entity type name inside box, separated from attributes by line
•	Label keys
–	(PK) after primary key attribute
–	(FK) after foreign key attribute
–	(PFK) after attribute which is both part of primary key and also a foreign key
Dependent entities
•	If entity type contains a PFK
–	Dependency on entity containing the attribute
–	Dependent entity type is drawn with rounded corners
Example
•	http://www.casestudio.com/screen/erd/cs2_erd1.png 
–	[from Case Studio]
Analysis of Bachman notation
•	More implementation(relational)-oriented
•	Cannot distinguish multivalued/composite attributes
•	Cannot represent ternary relationships
•	For both, need eventual representation
–	Ex: ternary relationship
•	Create entity type containing keys of participating entity types
Alternative (in Elmasri)
•	Attributes: Labeled ellipses attached to appropriate entity or relationship
–	Labeled ellipses attached to appropriate entity or relationship
–	Double ellipse for multivalued attributes
–	Composite attributes drawn like a tree of ellipses
–	Underline key attributes
–	Dashed ellipse : derived attribute
Alternative (continued)
•	Relationship drawn as diamond
–	connected to all participating entity types
–	double line for total/mandatory participation
–	label line with "1", "N", or "(min, max)" for cardinality
Alternative (continued)
•	Weak entity
–	Double rectangle
–	Double diamond for owner/identifying entity
•	Example (Kansas Univ. scan of Elmasri example)
–	http://www.ittc.ku.edu/~sgauch/647/s00/notes/Ch7a/sld012.htm